package it.polimi.authentication.web.beans;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

import it.polimi.authentication.ejb.usermanagement.PacchettoPredefinito;
import it.polimi.authentication.ejb.usermanagement.dto.CittaDTO;
import it.polimi.authentication.ejb.usermanagement.dto.PacchettoPredefinitoDTO;
import it.polimi.authentication.ejb.usermanagement.dto.Pacchetto_cittaDTO;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;




@ManagedBean (name="RetrieveCitta")
@SessionScoped
public class RetrieveCittaBean {
	
	@EJB
	private PacchettoPredefinito PP;
	
	private Map <String,String>citta = new LinkedHashMap<String, String>();
	private ArrayList<CittaDTO> CittaL;
	


	public RetrieveCittaBean()
	{
	}

	public ArrayList<CittaDTO>   getCittaL() {
		return CittaL;
	}
	
	public void setCittaL(ArrayList<CittaDTO>  CittaL) {
		this.CittaL = CittaL;
	}

	public Map <String,String> getCitta() {
		return citta;
	}
	
	public void setCitta(Map <String,String> Citta) {
		this.citta = Citta;
	}
	
	public void myCitta()
	{
		
		CittaL = PP.CittaList(); 
		for (int i=0; i<CittaL.size(); i++)
		{
			System.out.println (CittaL.get(i).getCitta());
		}
		//System.out.println("la mappa"+citta);
	}
	
}
